package main

import (
	"fmt"
	"reflect"
)

func main() {
	stu := Student {
		Name: "张三",
		Age: 18,
	}

	reflectStruct(&stu)
	fmt.Println(stu)
}

func reflectStruct(i interface{}) {
	reValue := reflect.ValueOf(i)
	reValue.Elem().Field(0).SetString("李四")
}

type Student struct{
	Name string
	Age int
}